import request from '@/utils/request'
import type { IFLoginInfo, IFLogin, IFLoginResponse } from './types/common'

export const getLoginInfo = () => {
  return request<IFLoginInfo>({
    url: '/login/info',
    method: 'GET'
  })
}

export const getCaptcha = () => {
  return request<Blob>({
    url: '/captcha_pro',
    method: 'GET',
    params: {
      _t: Date.now()
    },
    responseType: 'blob' // 请求获取图片数据
  })
}

export const login = (data: IFLogin) => {
  return request<IFLoginResponse>({
    url: '/login',
    method: 'POST',
    data
  })
}
